'************************************************************************************
' Copyright © 2003-2005 Kathleen Dollard
'
' This software is provided 'as-is', without any express or implied warranty. In no 
' event will the author be held liable for any damages arising from the use of this
' software.
' 
' You may use this software for any purpose, including commercial applications, 
' and you may redistribute this software as part of application delivery: however, 
' this copyright notice may not be removed and you may not otherwise redistribute 
' this software directly other than providing a link to wwww.gendotnet.com. 
'
' You may alter this software to better server your needs (I'd like to hear about your 
' changes in order to make the software better). If you alter the softwre, you must  
' clearly mark it as altered and must not be misrepresented as the original software.
' nor wholly your original work.
'*************************************************************************************
Option Strict On
Option Explicit On 

Imports System

Namespace KADGen.UserUtility
   Public Class UserUtilityOverrides
      Inherits Utility.BaseUtilityOverrides


      Public Overrides Function GetSingular(ByVal name As String) As String
         ' You need to override with both singular and plural forms. 
         ' To maintain case, return a variant of what is passed in
         ' Currently a name of nothing returns an empty string, but calling the base class lets this reflect future changes
         If name Is Nothing Then
            Return MyBase.GetSingular(name)
         Else
            Select Case name.Trim.ToLower
               Case "rswbs"
                  Return name
               Case "rswbss"
                  Return name.Substring(0, name.Length - 1)
               Case "updatehistorysy"
                  Return name
               Case "updatehistorysyx"
                  Return name.Substring(0, name.Length - 1)
               Case Else
                  Return MyBase.GetSingular(name)
            End Select
         End If
      End Function

      Public Overrides Function GetPlural(ByVal name As String) As String
         ' You need to override with both singular and plural forms. 
         ' To maintain case, return a variant of what is passed in
         ' Currently a name of nothing returns an empty string, but calling the base class lets this reflect future changes
         If name Is Nothing Then
            Return MyBase.GetPlural(name)
         Else
            Select Case name.Trim.ToLower
               Case "rswbs"
                  Return name
               Case "rswbss"
                  Return name & "s"
               Case "updatehistorysyx"
                  Return name
               Case "updatehistorysy"
                  Return name & "x"
               Case Else
                  Return MyBase.GetPlural(name)
            End Select
         End If
      End Function
   End Class
End Namespace